package com.igeekhome.ccs.controller;

import com.igeekhome.ccs.biz.ISystemMessageBiz;
import com.igeekhome.ccs.entity.SystemMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/smsg")
public class SystemMessageController {
    @Autowired
    private ISystemMessageBiz biz;

    @GetMapping("/get/all")
    @ResponseBody
    public List<SystemMessage> getAll(){
        List<SystemMessage> list = biz.getAll();
        if(list.size()==0){
            System.out.println("系统消息为空");
        }
        return list;
    }
}
